Skip to content

Implement cancellation notifications and handling #54

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Nov 15, 2024

Conversation

jspahrsummers
Copy link
Member

This should be pretty conventional for TypeScript, and offers ways to both issue cancellation as well as to handle receiving it.

Note I tried to add a test for receiving cancellation, but it turns out to be quite difficult because of the asynchrony (it ends up being caught too early, before any request handler is invoked, unless I introduce a delay in a test 🤮)

@jspahrsummers jspahrsummers merged commit 9db0057 into main Nov 15, 2024
4 checks passed
@jspahrsummers jspahrsummers deleted the justin/cancellation branch November 15, 2024 13:39

this._transport?.send({
jsonrpc: "2.0",
method: "cancelled",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this must be notifications/cancellation. I took the liberty of fixing this in #76.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants